[Zend YouTubeAPP] failed to upgrade a token

Posted by kwokwai on Stack Overflow See other posts from Stack Overflow or by kwokwai
Published on 2010-04-29T06:25:17Z Indexed on 2010/04/29 6:27 UTC
Read the original article Hit count: 320

Filed under:

Hi all,

I was testing Zend Gdata 1.10.1 in my localhost. I downloaded Zend Gdate from this link: http://framework.zend.com/download/webservices

Inside the Zend Gdata zip file, there was a folder called demos. I extracted it and used the YouTudeVideoApp to upload a sample video to Youtube.

But every time after I logged into Youtube, before it redirected me to my localhost, I received a warning message like this warning message:

localhost: This website is registered with Google to make authorization requests, but has not been configured to send requests securely. We recommend that you continue the process only if you trust the following destination: localhost:8080/youtube/operations.php

So I googled on how to resolve the problem of getting this warning message when I saw some people suggesed changing the value of $secure to True in operation.php. Here is the script mentioned:

function generateAuthSubRequestLink($nextUrl = null)
{
    $scope = 'http://gdata.youtube.com';
    $secure = true;
    $session = true;

    if (!$nextUrl) {
        generateUrlInformation();
        $nextUrl = $_SESSION['operationsUrl'];
    }

    $url = Zend_Gdata_AuthSub::getAuthSubTokenUri($nextUrl, $scope, $secure, $session);
    echo '<a href="' . $url
        . '"><strong>Click here to authenticate with YouTube</strong></a>';
}

After I altered the value of $secure to True, I found that the warning message changed to this:

localhost: Registered, secure. This website is registered with Google to make authorization requests

The new warning message is somehow shorter and looks better than the previous warning message. But once I pressed the Allow Access button, it turned out to be this:

ERROR - Token upgrade for CI3M6_Q3EOGkxoL-___wEYjffToQQ failed : Token upgrade failed. Reason: Invalid AuthSub header. Error 401 ERROR - Unknown search type - ''

I don't know why this happened.

Could you help me solve the problem please?

© Stack Overflow or respective owner

Related posts about youtube-api